function addFav(projId) {
    if(isNaN(parseInt(uid))) {
        layer.msg("请先登录!", {icon:5});
        return;
    }
    console.log("enter like");
    $.ajax({
        url: "./doFav",
        type: "POST",
        dataType: 'json',
        data: {
            "projectId" : projId,
        },
        success: function(data) {
            if (data.resultCode == 0) {
                layer.msg('喜欢成功！');
                $("#favbtn").removeClass("yellow-s");
                $("#favbtn").addClass("dissable");
            } else {
                layer.msg('喜欢失败！', {icon: 5});
            }
        },
        error:function(data){
            layer.msg('系统异常请稍后重试！', {icon: 5});
        }
    });
}

function voteProj(projId) {
    if(isNaN(parseInt(uid))) {
        layer.msg("请先登录!", {icon:5});
        return;
    }
    $.ajax({
        url: "./voteProj",
        type: "GET",
        dataType: 'json',
        data: {
            "projectId" : projId,
        },
        success: function(data) {
            if (data.resultCode == 0) {
                layer.msg('投票成功！');
                $("#voteBtn").removeClass("yellow-s");
                $("#voteBtn").addClass("dissable");
            } else {
                layer.msg('非法票！', {icon: 5});
            }

        },
        error:function(data){
            layer.msg('投票失败！', {icon: 5});
        }
    });
}
